// Copyright 2022 Chen Jun

#include <gtest/gtest.h>

#include <rclcpp/executors.hpp>
#include <rclcpp/node_options.hpp>
#include <rclcpp/utilities.hpp>

// STD
#include <memory>

#include "armor_detector/detector_node.hpp"

TEST(ArmorDetectorNodeTest, NodeStartupTest)
{
  rclcpp::NodeOptions options;
  auto node = std::make_shared<rm_auto_aim::ArmorDetectorNode>(options);
  node.reset();
}

// // 测试获取时间戳是否来自同一源（简单示意，实际可更复杂全面）
// TEST(TimeStampTest, CheckTimeSource)
// {
//     rclcpp::init(0, nullptr);
//     auto node = std::make_shared<rclcpp::Node>("test_node");
//     rclcpp::Time time1 = node->now();
//     rclcpp::Time time2 = node->now();
//     EXPECT_EQ(time1.get_clock()->get_clock_type(), time2.get_clock()->get_clock_type());
//     rclcpp::shutdown();
// }

int main(int argc, char ** argv)
{
  testing::InitGoogleTest(&argc, argv);
  rclcpp::init(argc, argv);
  auto result = RUN_ALL_TESTS();
  rclcpp::shutdown();
  return result;
}
